<template>
	<view class="">
		<view class="bgc">
			<view class="" style="margin-bottom: 0.6rem;font-size: 64rpx;">
				{{statistics.teamAgentNum}}
			</view>
			<text style="margin-right: 0.2rem;">累计代理数</text>(人)
			<view class="new">
				今日新增
				<text>{{statistics.todayNewAgentNum}}</text>人
			</view>
		</view>
		<view class="card-agency" style="" @click="individual">
			<view class="left" style="">
				<text>个人代理</text>
				<text style="color: #888889;">累计共计<text style="font-weight: bold;margin:0.2rem;">{{statistics.userAgentNum}}</text>人</text>
				<text style="color: #09c974;">今日新增<text style="font-weight: bold;margin:0.2rem;">{{statistics.todayNewLowerAgentNum}}</text></text>
			</view>
			<view class="right">
				<text>间接代理</text>
				<text style="color: #888889;">累计共计<text style="font-weight: bold;margin:0.2rem;">{{statistics.lowerTeamAgentNum}}</text>人</text>
				<text style="color: #09c974;">今日新增<text style="font-weight: bold;margin:0.2rem;">{{statistics.lowerTeamTodayNewAgentNum}}</text></text>
			</view>
		</view>
		<view class="card-active" @click="team">
			<view class="left" style="">
				<text>个人激活设备</text>
				<text style="color: #888889;">累计共计<text style="font-weight: bold;margin:0.2rem;">{{statistics.activateTerminalNum}}</text>台</text>
				<text style="color: #09c974;">今日新增<text style="font-weight: bold;margin:0.2rem;">{{statistics.todayActivateTerminalNum}}</text></text>
			</view>
			<view class="right">
				<text>团队激活设备</text>
				<text style="color: #888889;">累计共计<text style="font-weight: bold;margin:0.2rem;">{{statistics.teamActivateTerminalNum}}</text>台</text>
				<text style="color: #09c974;">今日新增<text style="font-weight: bold;margin:0.2rem;">{{statistics.teamTodayActivateTerminalNum}}</text></text>
			</view>
		</view>
	</view>
</template>

<script lang="js">
	import {
		agentStatistics
	} from "../../utils/uniApi"
	export default {
		data() {
			return {
				statistics: []
			}
		},
		mounted() {
			this.getAgentStatistics()
		},
		methods: {
			individual() {
				uni.navigateTo({
					url: "./individual"
				})
			},
			team() {
				uni.navigateTo({
					url: "./team"
				})
			},
			//代理统计首页
			getAgentStatistics() {
				let params = {
					userId: uni.getStorageSync("userId") == "" ? "" : parseInt(uni.getStorageSync("userId"))
				}
				agentStatistics(params).then(res => {
					this.statistics=res.data.data
					console.log(this.statistics,'代理+-+-+')
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bgc {
		background-color: #08c775;
		height: 450rpx;
		text-align: center;
		margin-top: 1rem;
		color: #FFFFFF;
		padding: 2rem 6rem;

		.new {
			border-radius: 30rpx;
			background-color: #07ad65;
			margin: 0.9rem 0;
			padding: 0.15rem 0.1rem;
		}
	}

	.card-agency,
	.card-active {
		width: 90%;
		height: 6rem;
		box-shadow: 1px 0px 15px #93dcc5;
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		background-color: #fff;
		position: fixed;
		top: 460rpx;
		left: 5%;

		.left,
		.right {
			display: flex;
			flex-direction: column;
			text-align: center;
			line-height: 1.2rem;
			width: 50%;
			border-right: 1px solid #e9ecf3;
		}
	}

	.card-agency {
		position: fixed;
		top: 460rpx;
		left: 5%;
	}

	.card-active {
		position: fixed;
		top: 740rpx;
		left: 5%;
	}
</style>
